package com.hsd.whb.utils;

import com.hsd.whb.exception.HwbException;
import org.springframework.validation.BindingResult;

public class ValidatorUtil {

    public static void valid(BindingResult bindingResult) {
        if (bindingResult.hasFieldErrors()) {
            throw new HwbException(bindingResult.getFieldError().getDefaultMessage());
        }
    }
}
